package com.fm.service;

import java.io.*;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.Socket;
import java.util.Scanner;

import static com.fm.Utils.Utils.getPropertiesFileData;
import static com.fm.Utils.Utils.sendOutputStreamText;

public class service {

    public static final String IP = "127.0.0.1";
    public static final int TCP_Port = 18888;


    /**
     *
     * @param num
     * @return
     */
    // 发送TCP请求
    public static Socket TCPClient(String num) {
        try {
            Socket socket = new Socket(IP, TCP_Port);
            // 获取输出流对象
            OutputStream outputStream = socket.getOutputStream();
            outputStream.write(num.getBytes());
            return socket;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }




}
